﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Microsoft_Phone_Controls_Maps="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps" 
    xmlns:es="clr-namespace:Microsoft.Expression.Shapes;assembly=Microsoft.Expression.Drawing" 
    x:Class="DroneControllerApp.AutoNavPage"
    mc:Ignorable="d" d:DesignWidth="728" d:DesignHeight="480"
    SupportedOrientations="Landscape"  Orientation="Landscape"
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="DataTemplate1">
            <Border BorderThickness="3" Background="Black">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock TextWrapping="Wrap" Text="{Binding}" d:LayoutOverrides="Width, Height"/>
                </Grid>
            </Border>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>
 
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0" DataContext="{Binding}">
            <Grid.ColumnDefinitions>
            	<ColumnDefinition />
            	<ColumnDefinition />
            	<ColumnDefinition />
            	<ColumnDefinition />
            	<ColumnDefinition />
            	<ColumnDefinition />
            	<ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
            	<RowDefinition Height="*"/>
            	<RowDefinition Height="*" />
            	<RowDefinition Height="*"/>
            	<RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Microsoft_Phone_Controls_Maps:Map x:Name="navMap" CredentialsProvider="AkhTUCteaLm4DZyaI2DJXoqs5_GCoEapZ2MqheHYoCZWouS0t5EhpWndSvSKuVPf" Margin="0" d:LayoutOverrides="Height" Grid.RowSpan="4" Grid.ColumnSpan="5" Grid.Column="1">
            	<Rectangle Width="20" Height="20">
            		<Rectangle.Fill>
            			<ImageBrush Stretch="UniformToFill" ImageSource="cross.png"/>
            		</Rectangle.Fill>
            	</Rectangle>
            </Microsoft_Phone_Controls_Maps:Map>
            <Button HorizontalAlignment="Center" x:Name="ConnectButton" VerticalAlignment="Top" Click="ConnectButton_Click" Content="Connect" Background="Maroon" Grid.Column="6" Margin="0" Padding="0" Width="100" FontSize="16" Height="50" >
            	<Button.BorderBrush>
            		<SolidColorBrush Color="White" Opacity="0.25"/>
            	</Button.BorderBrush>
            	<Button.Foreground>
            		<SolidColorBrush Color="White" Opacity="0.25"/>
            	</Button.Foreground>
            </Button>

        <!--<ListBox HorizontalAlignment="Left" x:Name="TraceBox" VerticalAlignment="Top" ItemsSource="{Binding}" Grid.Row="4" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" ItemTemplate="{StaticResource DataTemplate1}" Grid.ColumnSpan="4" Grid.RowSpan="7" />-->
            <Button Content="Go!" Grid.RowSpan="1" Height="75" HorizontalAlignment="Center" Margin="0" x:Name="AutoNavButton" VerticalAlignment="Center" Width="80" Grid.Row="3" Padding="0" ClickMode="Release" Click="AutoNavButton_Click" Grid.Column="6" FontSize="21.333" >
            	<Button.Foreground>
            		<SolidColorBrush Color="White" Opacity="0.75"/>
            	</Button.Foreground>
            	<Button.BorderBrush>
            		<SolidColorBrush Color="White" Opacity="0.75"/>
            	</Button.BorderBrush>
            	<Button.Background>
            		<SolidColorBrush Color="#FF0FC630" Opacity="0.75"/>
            	</Button.Background>
            </Button>
            <Button Content="Save" Grid.RowSpan="1" Height="75" HorizontalAlignment="Center" Margin="0" x:Name="SaveButton" VerticalAlignment="Center" Width="80" Grid.Row="2" Padding="0" ManipulationStarted="ButtonAutoNav_ManipulationStarted" ManipulationCompleted="ButtonAutoNav_ManipulationCompleted" Grid.Column="6" FontSize="21.333" >
            	<Button.Foreground>
            		<SolidColorBrush Color="White" Opacity="0.75"/>
            	</Button.Foreground>
            	<Button.BorderBrush>
            		<SolidColorBrush Color="White" Opacity="0.75"/>
            	</Button.BorderBrush>
            	<Button.Background>
            		<SolidColorBrush Color="#FF6987BF" Opacity="0.75"/>
            	</Button.Background>
            </Button>
            <Button Content="PushPin" Grid.RowSpan="1" Height="75" HorizontalAlignment="Center" Margin="5,0,0,0" x:Name="PushPinButton" VerticalAlignment="Center" Width="80" Grid.Row="1" Padding="0" FontSize="21.333" Foreground="{x:Null}" BorderBrush="{x:Null}" BorderThickness="0" Click="PushPinButton_Click">
            	<Button.Background>
            		<ImageBrush Stretch="UniformToFill" ImageSource="pushPin.png"/>
            	</Button.Background>
            </Button>
            <RadioButton x:Name="InOrder" Content="" Margin="10,0,0,0" Grid.Row="2" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Top" IsChecked="True"/>
            <RadioButton x:Name="ShortestPath" Content="" Margin="10,0,0,0" Grid.Row="3" FontSize="16" Width="68" Height="72" HorizontalAlignment="Center" VerticalAlignment="Top"/>
            <TextBlock x:Name="InOrder1" TextWrapping="Wrap" Text="In Order" VerticalAlignment="Bottom" Margin="0,0,0,15" d:LayoutOverrides="Width" FontSize="16" Foreground="#FF6987BF" HorizontalAlignment="Center" Grid.Row="2"/>
            <TextBlock x:Name="Shortest" TextWrapping="Wrap" Text="Shortest" VerticalAlignment="Bottom" Margin="0,0,0,15" d:LayoutOverrides="Width" FontSize="16" Grid.Row="3" HorizontalAlignment="Center" Foreground="#FF6987BF"/>
            <Button Grid.RowSpan="1" Height="75" HorizontalAlignment="Center" Margin="0" x:Name="FindMeButton" VerticalAlignment="Center" Width="80" Padding="0" ManipulationStarted="ButtonAutoNav_ManipulationStarted" ManipulationCompleted="ButtonAutoNav_ManipulationCompleted" FontSize="21.333" Foreground="{x:Null}" BorderBrush="{x:Null}" Background="{x:Null}" >
            	<es:RegularPolygon x:Name="CurrentStar" Fill="Red" Height="45" InnerRadius="0.47211" PointCount="5" Stretch="Fill" Stroke="Black" UseLayoutRounding="False" Width="45" Margin="5,0,0,0"/>
            </Button>
            <TextBlock x:Name="FindMe" TextWrapping="Wrap" Text="Find Me" VerticalAlignment="Bottom" Margin="0,0,0,5" FontSize="16" HorizontalAlignment="Center" Foreground="#FFEF0A0A"/>
            <TextBlock x:Name="NewPin" TextWrapping="Wrap" Text="New Pin" VerticalAlignment="Bottom" Margin="0" FontSize="16" HorizontalAlignment="Center" Foreground="#FFB6E857" Grid.Row="1"/>
            <ListBox x:Name="listBox" Grid.Column="6" Margin="0" Grid.Row="1" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Top"/>
            <Button HorizontalAlignment="Center" x:Name="LandButton" VerticalAlignment="Bottom" Content="LAND" Click="LandButton_Click" Background="#FFF93535" Grid.Column="6" Margin="0" Padding="0" Width="100" FontSize="16" Height="50" >
            	<Button.BorderBrush>
            		<SolidColorBrush Color="White" Opacity="0.25"/>
            	</Button.BorderBrush>
            	<Button.Foreground>
            		<SolidColorBrush Color="White" Opacity="0.25"/>
            	</Button.Foreground>
            </Button>
        </Grid>
        <ListBox x:Name="gpsBox" Grid.Column="3" Margin="0" Width="300" Height="200" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.RowSpan="4" Grid.Row="1">
        	<ListBox.Background>
        		<SolidColorBrush Color="#FF3EA610" Opacity="0.5"/>
        	</ListBox.Background>
        </ListBox>
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="0,0,0,-3">
        	<TextBlock x:Name="ApplicationTitle" Style="{StaticResource PhoneTextNormalStyle}" Margin="10,0,0,0"><Run Text="Drone Controller -- "/><Run Text="Texas A&amp;M University"/></TextBlock>
        	<TextBlock x:Name="PageTitle" Margin="15,0,0,0" Style="{StaticResource PhoneTextTitle1Style}" HorizontalAlignment="Left" Foreground="White" ><Run Text="AR."/><Run Text="UAV">
        			<Run.Foreground>
        				<SolidColorBrush Color="#FF6987BF">
        					<SolidColorBrush.RelativeTransform>
        						<MatrixTransform Matrix="Identity"/>
        					</SolidColorBrush.RelativeTransform>
        					<SolidColorBrush.Transform>
        						<MatrixTransform Matrix="Identity"/>
        					</SolidColorBrush.Transform>
        				</SolidColorBrush>
        			</Run.Foreground>
        		</Run><Run Text=" NewRoute"/></TextBlock>
        </StackPanel>
    </Grid>

</phone:PhoneApplicationPage>
